$(document).ready(function() {
  
    $("[data-role=page]").live("pageshow",function(event) {
        
        // book page
        if(this.id == "page_book") {
          $(".like_button_img").click(function(evt){
				
                var isbn13 = evt.currentTarget.attributes['isbn13'].nodeValue;
                var src = evt.currentTarget.attributes['src'].nodeValue;
                info ='isbn13='+isbn13
                $.ajax({
                    type: 	"POST",
                    url: 	"/api/like",
                    data:	info,
                    success: function(){
                        var stat = src;
                        if (stat == '/icons/like.png'){
                            $('.like_button_img').attr('src', '/icons/like_before.png')
                        }else {
                            $('.like_button_img').attr('src', '/icons/like.png')
                        }
                    }
                });
            });
        }
    });
    
    /*
    
    
    */
});